package com.ji.li.reactadminproexampleservice.entity.http;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;

public class ResEntity {
    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public JSON getData() {
        return data;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(JSONObject data) {
        this.data = data;
    }

    public void setCodeAndMessage(ResEnum resEnum) {
        this.code = resEnum.getCode();
        this.message = resEnum.getMsg();
    }

    public ResEntity(int code, String message, JSONObject data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResEntity(ResEnum resEnum, JSON data) {
        this.code = resEnum.getCode();
        this.message = resEnum.getMsg();
        this.data = data;
    }

    public ResEntity() {
    }

    private int code;
    private String message;
    private JSON data;
}
